<!--设备实时卡片：显示读数组件-->
<template>
  <div>
    <div class="boddd">
      <p class="textLeft">{{property.name}}</p>
      <p class="textRgiht">{{property.value === null ? 'N/A' : (switcher[property.value] ? switcher[property.value] : '无效状态码')}}</p>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'StatusLine',
    props: ['did', 'property'],
    created: function () {
    },
    data: function () {
      return {
        switcher: {
          1000: '未开阀',
          1001: '开阀中',
          1002: '阀未开到位',
          1003: '阀已开到位',
          1004: '阀未关到位',
          1005: '阀已关到位',
          1006: '停止开阀',
          1007: '打开阀门',
          1008: '停止关阀',
          1009: '关闭阀门',
          1010: '就地',
          1011: '远程',
          1012: '停止',
          1013: '运行',
          1014: '正常',
          1015: '故障',
          1016: '非远程启动',
          1017: '远程启动',
          1018: '非远程停止',
          1019: '远程停止',
          1020: '本地手动',
          1021: '远程自动',
          1022: '工频模式',
          1023: '变频运行',
          1024: '水泵运行',
          1025: '过载报警',
          1026: '故障报警',
          1027: '变频器备妥'
        }
      }
    },
    methods: {
    },
    beforeDestroy () {
    }
  }
</script>

<style scoped>
  .boddd {
    display: flex;
  }
  .textLeft {
    /*float: left;*/
    /*width: 30%;*/
    text-align: left;
    flex: 2;
    overflow: hidden;
    white-space: nowrap;
  }

  .textRgiht {
    /*float: left;*/
    /*width: 20%;*/
    text-align: right;
    flex: 4;
  }
</style>
